package com.lzc.springboot.service.impl;

import com.lzc.springboot.domain.Farmer;
import com.lzc.springboot.domain.Question;
import com.lzc.springboot.mapper.QuestionMapper;
import com.lzc.springboot.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class QuestionServiceImpl implements QuestionService {

  @Autowired
  private QuestionMapper questionMapper;

  @Override
  public Question[] findAllUnsolved(int fid) {
    return questionMapper.findAllUnsolved(fid);
  }

  @Override
  public Question[] findAllSolved(int fid) {
    return questionMapper.findAllSolved(fid);
  }

  @Override
  public void delQuestionById(int id) {
    questionMapper.delQuestionById(id);
  }

  @Override
  public void addQuestion(Question question) {
    questionMapper.addQuestion(question);
  }

  @Override
  public Question[] findAllSolvedByEid(int eid) {
    return questionMapper.findAllSolvedByEid(eid);
  }

  @Override
  public Question[] findAllUnsolvedByEid(int eid) {
    return questionMapper.findAllUnsolvedByEid(eid);
  }

  @Override
  public void answerQuestion(Question question) {
    questionMapper.answerQuestion(question);
  }

  @Override
  public Question[] findUnresolvedQuestionByText(Farmer farmer) {
    return questionMapper.findUnresolvedQuestionByText(farmer);
  }

  @Override
  public Question[] findSolvedQuestionByText(Farmer farmer) {
    return questionMapper.findSolvedQuestionByText(farmer);
  }
}
